/** * Version: 3.1.0 * Date: 2020-11-03 */ 'use strict';var Blinkloader=function(){function M(a){var b=v.map(function(c){return a.style[c]});a.addEventListener("transitionend",function(){a.style.opacity="";b.forEach(function(c,e){a.style[v[e]]=c})},{once:!0});v.forEach(function(c){a.style[c]="opacity 1s"});a.style.opacity="1"}function k(a){return void 0!==a&&null!==a}function N(a){var b={};a.replace(/\s/g,"").split(";").forEach(function(c){c=c.split(":");b[n(c[0])]=c[1]||""});return b}function n(a){return a.replace(/-(.)/g,function(b){return b.toUpperCase()}).replace(/-/g, "").replace(/^(.)/,function(b){return b.toLowerCase()})}function O(){}function q(a){console.error("Blinkloader: "+a);[].slice.call(arguments).slice(1).forEach(function(b){console.error(b)})}function l(a){this.node=a.node;this.K();var b;if(b=a.node.dataset.blinkSrc)b=document.createElement("a"),b.href=a.node.dataset.blinkSrc,b=b.href;b=b||a.node.dataset.blinkUuid&&d.m+"/"+a.node.dataset.blinkUuid+"/";var c;if(!(c=a.a)){c=a.node.dataset.blinkSrc;var e=a.node.dataset.blinkUuid;var f=b;f=f.substring(1+ f.lastIndexOf("/"));f=f.split("?")[0];f=f.split("#")[0];f=f.split(".")[1];var m=b.substring(1+b.lastIndexOf("/"))||void 0;var g=(g=a.node.clientWidth)&&1=e?"-/resize/"+Math.min(Math.max(c,0),g)+"x":"-/resize/x"+Math.min(Math.max(e,0),g)}if("format"===h&&B(b,c,e))return"-/format/jpeg";if(void 0!==b.b[h]){var p=[];if("autorotate"===h)return"-/autorotate/yes";if("progressiveJpeg"===h)return"-/progressive/yes";"overlayUuid"===h?p=["-/overlay",b.b[n(g[0])],b.b[n(g[1])],b.b[n(g[2])],b.b[n(g[3])]]:(h="-/"+g[0].replace(/-/g,"_"),p.push(h),g.forEach(function(r){p.push(b.b[n(r)])}));return p.filter(Boolean).join("/")}}).filter(Boolean).join("/"); b.url=a.a.H?[b.url,m].join("")+"/":0===b.url.indexOf(d.m)?[b.url.slice(0,b.url.lastIndexOf("/")),m,b.filename].join("/"):["https://"+d.host,m,b.url].filter(Boolean).join("/");return new l({node:a.node,a:b})}function S(a){var b=JSON.parse(JSON.stringify(a.a));b.url=a.a.H?[b.url,"-/blur/100/-/progressive/yes/-/resize/65x/"].join(""):["https://"+d.host+"/","-/blur/100/-/progressive/yes/-/resize/65x/",b.url].join("");return new l({node:a.node,a:b})}function B(a,b,c){return 3E3c.bottom||0<=c.top-b)}b&&G?u.push(a):a.c()})}catch(a){q("can't render images", a),setTimeout(F,3E3)}}var d={valid:!1,host:void 0,X:void 0,A:!0,f:!1,j:!0,v:5,u:250,I:void 0,g:void 0,i:!1,F:!0,J:!0,G:!0,s:!1,m:"https://ucarecdn.com"},w={U:!1,T:!1,protocol:"https",B:!1,width:0},A=[["preview"],["scale-crop","scale-crop-position"],["stretch"],["setfill"],["format"],["quality"],["progressive-jpeg"],["srgb"],["max-icc-size"],["enhance"],["sharp"],["blur","blur-strength"],["brightness"],["exposure"],["gamma"],["contrast"],["saturation"],["vibrance"],["warmth"],["filter","filter-amount"], ["grayscale"],["invert"],["autorotate"],["rotate"],["flip"],["mirror"],["overlay-uuid","overlay-dimensions","overlay-coordinates","overlay-opacity"],["resize"],["crop","crop-position"]],H=Array.prototype.concat.apply([],A);l.prototype.K=function(){"IMG"!==this.node.nodeName||this.node.src||(this.node.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=")};l.prototype.N=function(a){var b={};a.blinkOps&&(b=N(a.blinkOps));H.forEach(function(c){var e= n(c);c=a[n("blink-"+c)];void 0!==c&&(b[e]=c)});d.J&&(b.format=b.format||"auto");b.O=b.O||"";return b};l.prototype.C=function(a){var b=new window.Image;b.onload=function(){a(void 0,!0)};b.onerror=function(c){a(c,!1)};b.src=this.a.url};l.prototype.S=function(){this.node.src=this.a.url};l.prototype.R=function(){var a=this;[["background-size","cover"],["background-position","center"],["background-repeat","no-repeat"],["background-image",a.a.L+"url("+a.a.url+")"]].forEach(function(b){a.node.style.setProperty(b[0], b[1])})};l.prototype.c=function(){this.a.M?this.S():this.R()};l.prototype.D=function(a){var b=this;b.C(function(c,e){a(c,e);!c&&b.c()})};l.prototype.P=function(){var a=this;"src uuid lazyload gradient background progressive image-block ops".split(" ").forEach(function(b){a.node.removeAttribute("data-blink-"+b)});H.forEach(function(b){a.node.removeAttribute("data-blink-"+b)})};var z={},v=["transition","webkitTransition","mozTransition"],u=[],D=!1,G=!1;return{optimize:function(a){try{if(a)if(a.host|| a.pubkey){d.host=a.host||a.pubkey+".ucr.io";var b=a.fallback,c=a.progressive,e=a.lazyload,f=a.responsive,m=a.webp,g=a.retina,h=a.smartCompression,p=a.batchSize,r=a.batchInterval,I=a.viewHeight,J=a.beforeRender,K=a.fadeIn,L=a.cdnBase;k(b)&&(d.A=b);k(c)&&(d.f=c);k(e)&&(d.j=e);k(f)&&(d.F=f);k(m)&&(d.J=m);k(g)&&(d.G=g);k(h)&&(d.s=h);k(p)&&(d.v=p);k(r)&&(d.u=r);k(I)&&(d.I=I);k(J)&&(d.g=J);k(K)&&(d.i=K);if(k(L)){var x=document.location.protocol;"http:"!==x&&(x="https:");var T=L.replace(/^\/\//,x+"//").replace(/\/+$/, "");d.m=T}d.valid=!0}else q("pubkey or host are not specified");else q("missing config")}catch(t){q("configuration is invalid",t)}try{w.B=window.matchMedia("(-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2), (min-resolution: 192dpi)").matches,w.width=window.innerWidth}catch(t){q("couldn't populate device parameters",t)}try{window.addEventListener("scroll",E),C(),setInterval(C,d.u),G=!0}catch(t){q("couldn't initialize lazy loading",t)}F()}}}()